home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form frmSelTable
- BorderStyle = 3 'Fixed Double
- Caption = "Select Table"
- ClientHeight = 1575
- ClientLeft = 3090
- ClientTop = 2700
- ClientWidth = 5250
- ControlBox = 0 'False
- Height = 1980
- Left = 3030
- LinkTopic = "Form2"
- ScaleHeight = 1575
- ScaleWidth = 5250
- Top = 2355
- Width = 5370
- Begin CommandButton Command1
- Cancel = -1 'True
- Caption = "&Cancel"
- Height = 375
- Left = 2880
- TabIndex = 3
- Top = 1080
- Width = 975
- End
- Begin CommandButton cmdOK
- Caption = "&OK"
- Default = -1 'True
- Height = 375
- Left = 4080
- TabIndex = 2
- Top = 1080
- Width = 975
- End
- Begin ComboBox cmbSelectTable
- Height = 300
- Left = 480
- TabIndex = 0
- Top = 600
- Width = 4575
- End
- Begin Label Label1
- Caption = "Select a table:"
- Height = 255
- Left = 240
- TabIndex = 1
- Top = 240
- Width = 4215
- End
- Option Explicit
- Sub cmdOK_Click ()
- 'cmbSelectTable.Text = cmbSelectTable.List(cmbSelectTable.ListIndex)
- Form1!lblCurrTable = cmbSelectTable.Text
- Unload Me
- End Sub
- Sub Command1_Click ()
- Unload Me
- End Sub
- Sub CreateList ()
- Dim Msg
- Dim td As TableDef
- Dim db As Database
- Dim tCount, i
- On Error GoTo SetError
- Set db = OpenDatabase(Form1!lblCurrDatabase)
- tCount = db.TableDefs.Count
- For i = 0 To tCount - 1
- If (db.TableDefs(i).Attributes And DB_SYSTEMOBJECT) = False Then cmbSelectTable.AddItem db.TableDefs(i).Name
- Next
- cmbSelectTable.Text = Form1!lblCurrTable
- Exit Sub
- SetError:
- Msg = Err & " " & Error & NL
- Msg = Msg & " Trying to open database"
- MsgBox Msg
- Unload Me
- Exit Sub
- End Sub
- Sub Form_Load ()
- CreateList
- End Sub
-